<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>

	<body>
	
	</body>
	<script>
		function setCookie(name, value) {
			var Days = 30;
			var exp = new Date();
			exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
			document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString();
		}

		//读取cookies 
		function getCookie(name) {
			var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");

			if(arr = document.cookie.match(reg))

				return unescape(arr[2]);
			else
				return null;
		}

		function getQueryString(name) {
			var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
			var r = window.location.search.substr(1).match(reg);
			if(r != null) return unescape(r[2]);
			return null;
		}
		
		var codes = getQueryString('code');
		if(codes!=null && codes!='' && codes!=undefined){
			console.log('back=' + getCookie('payMsg'));
			setCookie('paycode',codes);
			//window.location.href='http://www.jubenxiong.com/aml/?#/payAffirm/';
			window.location.href='http://www.amyshirley.com/aml/index.html?';
			//window.location.replace('http://www.jubenxiong.com/aml2/index.html?');
			
		}
		else{
			console.log('hehe');
		}
	</script>

</html>